<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>后盾人</title>
  </head>
  <body></body>
  <script>
    // let sum = [1, 3, 2, 4, 6].reduce((a, b) => a + b);
    // console.log(sum);
    function sum(...args) {
      // console.log(args);
      return args.length == 0 ? 0 : args.pop() + sum(...args);
      // if (args.length == 0) {
      //   return 0;
      // }
      // return args.pop() + sum(...args);
    }
    console.log(sum(1, 2, 4, 6, 5, 8));

    // function cms(...args) {
    //   console.log(args);
    // }
    // console.log(cms([1, 2, 3]));
  </script>
</html>
